<%@page contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>::JSP 프로젝트 v1::</title>
<link href="css/normalize.css" rel="stylesheet">
<link href="css/dasom.css" rel="stylesheet">
<style type="text/css">
	/*회원가입 폼 정렬*/
	#joinfrm{/*border:1px solid red; */width:365px;}
	#joinfrm label{width:120px; text-align:right; font-weight:bold;
					display:inline-block; padding:0 10px 0 0;}
	#joinfrm div{margin:10px 10px;}
</style>
</head>
<body>
	<!-- 상단 영역 시작 -->
	<jsp:include page="layout/header.jsp"/>
	<%--동적포함: include 지시문과는 달리 포함된 jsp를 각각 실행하고 그 결과만 현재문서에 포함함 --%>
	<%--즉,join.jsp와 header.jsp, footer.jsp를 따로 실행하고 그 결과만 하나로 합쳐 출력함 --%>
	
	<div id="contents">
	<h2>::회원가입::</h2>
		<form name="joinfrm" id="joinfrm" class="centerme">
			<div><label for="userid">아이디</label>
			<input type="text" name="userid" id="userid"></div>
			
			<div><label for="passwd">비밀번호</label>
			<input type="text" name="passwd" id="passwd"></div>
			
			<div><label for="repasswd">비밀번호 확인</label>
			<input type="text" name="repasswd" id="repasswd"></div>
			
			<div><label for="name">이름</label>
			<input type="text" name="name" id="name"></div>
			
			<div><label for="email">전자우편</label>
			<input type="text" name="email" id="email"></div>
			
			<div><label></label><button type="button" id=joinokbtn>입력완료</button>
			<button type="reset">다시입력</button></div>
		</form>
	</div>
	<!-- 하단 영역 끝 -->
	<jsp:include page="layout/footer.jsp"/>
	
	<script type="js/jquery-1.11.1.min.js"></script>
	<script type="js/dasom.js"></script>
	<script type="text/javascript">
	
	var joinbtn=document.getElementById("joinokbtn");
	joinbtn.onclick=function(){joinme();};
	</script>
	<script type="text/javascript">
	
	function joinme(){
		var joinfrm=document.getElementById("joinfrm");
		if(joinfrm.userid.value=="")
			
			alert('아이디를 입력하세요!');
		else if(joinfrm.passwd.value=="")
			alert('비밀번호를 입력하세요!');
		else if(joinfrm.repasswd.value!=joinfrm.passwd.value)
			alert('비밀번호를 다시 확인해주세요!');
		else if(joinfrm.name.value=="")
			alert('이름을 입력해주세요!');
		else if(joinfrm.email.value=="")
			alert('전자우편을 입력해주세요!');
		
		else{
			joinfrm.method="post";
			joinfrm.action="joinok.jsp";
			joinfrm.submit();
			}
		
		}
	
	
	</script>
</body>
</html>
